---@diagnostic disable: lowercase-global, undefined-global, trailing-space
---@type data_containerUI
local params = {}

params.kkd_fleshsack = {
    widget = {
        animbank = 'ui_chester_upgraded_3x4',
        animbuild = 'ui_chester_upgraded_3x4',
        slotpos = {},
        slotbg = {},
        pos = Vector3(0, 220, 0),
        side_align_tip = 160,
        --buttoninfo = {
        --    text = '改造！',
        --    position = Vector3(0, 80 * -2 + 10, 0)
        --},
        dragtype_drag = 'kkd_fleshsack',
        unique = 'kkd_fleshsack'
    },
    type = 'chest',
    itemtestfn = function(container, item, slot)
        -- if slot == nil then -- 这样设置就能让shift左键失效,还能保证giveitem能用,我也不知道原因,群佬没告诉我
        --     return false
        -- end
        if item:HasTag('kkd_implant') then 
            local _, num = container:Has(item.prefab, 0)
            if not TUNING.MOD_KUKUDE.IO[string.upper(string.sub(item.prefab,4))]
            or not TUNING.MOD_KUKUDE.IO[string.upper(string.sub(item.prefab,4))].COUNT_LIMIT
            or num < TUNING.MOD_KUKUDE.IO[string.upper(string.sub(item.prefab,4))].COUNT_LIMIT then
                return true
            end 
        end
        return false
    end
}

for y = 2.5, -0.5, -1 do
    for x = 0, 2 do
        table.insert(params.kkd_fleshsack.widget.slotpos, Vector3(75 * x - 75 * 2 + 75, 75 * y - 75 * 2 + 75, 0))
        table.insert(params.kkd_fleshsack.widget.slotbg, { atlas='images/slotbg/merged_img_1732977600.xml',image = '1.tex' })
    end
end

-- params.new_ui = {
--     widget =
--     {
--         animbank = 'ui_chest_3x3',
--         animbuild = 'ui_chest_3x3', 
--         slotpos = {},
--         slotbg = {},
--         pos = Vector3(-340, -120, 0),
--         side_align_tip = 160,
--         buttoninfo = {
--             text = 'hit',
--             position = Vector3(0, 80*-2+10, 0),
--         },
--         dragtype_drag = 'new_ui',
--         unique = 'new_ui',
--     },
--     type = 'new_ui',
--     itemtestfn = function(container, item, slot)
--         -- if slot == nil then -- 这样设置就能让shift左键失效,还能保证giveitem能用,我也不知道原因,群佬没告诉我
--         --     return false 
--         -- end
--         -- if item:HasTag('gem') then return true end
--         -- return false
--     end
-- }

-- for y = 2, 0, -1 do
--     for x = 0, 1 do
--         table.insert(params.new_ui.widget.slotpos, Vector3(80 * (x - 2) + 130, 80 * (y - 2) + 75, 0))
--         -- table.insert(params.new_ui.widget.slotbg, { atlas="images/slotbg/.xml",image = ".tex" })
--     end
-- end

return params
